<template>
	<view>
		<scroll-view class="scroll" scroll-x="true">
			<view :style="{width:width+'upx',height:height+'upx'}" class="scroll-item">
				<view class="box">
					<!-- 电器图片 分为左部分 -->
					<u-image border-radius="5" class="img" width="173upx" height="173upx" src="../static/images/1.png">
					</u-image>
					<view class="item-right">
						<!-- 电器介绍 -->
						<view class="text">
							<text>1.7L大容量</text>
							<text>304不锈钢</text>
							<text>无缝内胆</text>
						</view>
						<!-- 更多 -->
						<view class="more">

						</view>
					</view>
				</view>
			</view>


			<view :style="{width:width+'upx',height:height+'upx'}" class="scroll-item">
				<view class="box">
					<!-- 电器图片 分为左部分 -->
					<view class="item-left">
						<u-image border-radius="5" class="img" width="173upx" height="173upx"
							src="../static/images/2.png">
						</u-image>
					</view>
					<view class="item-right">
						<!-- 电器介绍 -->
						<view class="text-two">
							<text>出水断电 无电洗浴</text>
							<text>智能控温 节能省电</text>
							<text>变频速热 超长保温</text>
						</view>
						<!-- 更多 -->
						<view class="more">

						</view>
					</view>
				</view>
			</view>


			<view :style="{width:width+'upx',height:height+'upx'}" class="scroll-item">
				<view class="box">
					<!-- 电器图片 分为左部分 -->
					<view class="item-left">
						<u-image border-radius="5" class="img" width="173upx" height="173upx"
							src="../static/images/1.png">
						</u-image>
					</view>
					<view class="item-right">
						<!-- 电器介绍 -->
						<view class="text">
							<text>1.7L大容量</text>
							<text>304不锈钢</text>
							<text>无缝内胆</text>
						</view>
						<!-- 更多 -->
						<view class="more">

						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		name: "scroll-x",
		data() {
			return {

			};
		},
		props: ['width', 'height', ]
	}
</script>

<style lang="scss" scoped>
	.scroll {
		display: inline-block;
		white-space: nowrap;
		width: 100%;
	}

	.scroll-item {
		display: inline-block;
		width: 200px;
		margin-right: 20upx;
		background-color: #dadada;
		border-radius: 2px;
		margin-left: 10upx;
	}

	// 以上是组件壳子样式
	.box {
		display: flex;
		overflow: hidden;
		.item-left {
			flex: 1;
		}

		.item-right {
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			.text {
				display: flex;
				flex-direction: column;
				font-size: 10upx;
				font-weight: normal;
				font-stretch: normal;
				line-height: 26rpx;
				letter-spacing: 0rpx;
				color: #666666;
				text-align: center;
			}

			.more {
				background: url(../static/images/move.png) no-repeat;
				width: 58px;
				background-size: 100%;
				height: 21px;
				margin: 0 auto;
				transform: scale(1);
			}
		}
	}

	.text-two {
		display: flex;
		flex-direction: column;
		font-size: 10upx;
		font-weight: normal;
		font-stretch: normal;
		letter-spacing: 0rpx;
		color: #666666;
		transform:scale(.8);
		width: 100%
	}
</style>
